/***
 * @description axios封装
 * @file api.ts
 * @author andy
 * @date 2024/3/22 16:40
 */
// file:api.s
// 1、导入axios以及拦截器
import service from "./request";

// demo接口1
export const demo1 = (data: any) => {
  return service({
    url: "/user/user/demo1/" + data,
    method: "post",
  });
};

// demo接口2
export const demo2 = (data: any) => {
  return service({
    url: "/user/user/demo2",
    method: "post",
    data,
  });
};

//商品列表
export const getProdList = (data: any) => {
  return service({
    url: "/product/product/getProdList",
    method: "post",
    data,
  });
};
//批量删除
export const deleteBatchProd = (data: any) => {
  return service({
    url: "/product/product/deleteBatchProd",
    method: "post",
    data,
  });
};
// 字典表数据
export const getDictByType = (dictType: any) => {
  return service({
    url: "/product/product/getDictByType/" + dictType,
    method: "post",
  });
};

//添加商品
export const addProd = (data: any) => {
  return service({
    url: "/product/product/addProd",
    method: "post",
    data,
  });
};
//添加商品附件
export const addProdAtta = (data: any) => {
  return service({
    url: "/product/product/addProdAtta",
    method: "post",
    data,
  });
};
//商品信息
export const prodInfoList = () => {
  return service({
    url: "/product/product/prodInfoList",
    method: "post",
  });
};
// 字典表数据
export const getProd = (prodId: any) => {
  return service({
    url: "/product/product/getProd/" + prodId,
    method: "post",
  });
};

//列表
export const getProdInfoList = (data: any) => {
  return service({
    url: "/product/product/getProdInfoList",
    method: "post",
    data,
  });
};
//添加
export const addProdInfo = (data: any) => {
  return service({
    url: "/product/product/addProdInfo",
    method: "post",
    data,
  });
};
